<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::prefix('v1/cart')->namespace('API')->group(function () {

    // 需要微信登录获取用户身份
    Route::middleware('auth:wechat')->group(function () {

        Route::get('/', 'CartController@list');
        Route::post('/', 'CartController@add');
        // Route::delete('/{goods}', 'CartController@destroy');
        Route::delete('/clear', 'CartController@clear');
    });
});